 |
|
 |
Subject: How create Reminder with LotusScript |
 |
 |
 |
Product Area: Domino Designer on Eclipse (DDE) |
 |
Technical Area: Application Development |
 |
Platform: Windows |
 |
Release: 8.5.2 |
 |
Reproducible: Always |
 |
 |
 |
 |
Hi,
In a simple application, I use a button to create a reminder in the user's personal Calendar.
In a form I have a date (DateMAX) and a button to create this reminder
But the informations in fields doesn't appear in the Calendar Entry window:
1- Date is Today date instead of fieldValue
2- Body still empty
Here the code
==============
Sub Click(Source As Button)
Dim Session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim doc As NotesDocument
Dim db As NotesDatabase
Dim doc_cal As NotesUIDocument
Dim CurDoc As NotesDocument
Dim dbMail As New NotesDatabase( "", "" )
Dim uiCurDoc As NotesUIDocument ' for modification
Dim rtitem As NotesRichTextItem
Dim item As NotesItem
Dim times As Variant
Dim count As Integer
Dim serveur As String
Call dbMail.OpenMail
serveur = dbMail.Server
Set uiCurDoc = workspace.CurrentDocument
Set CurDoc = workspace.CurrentDocument.Document
Set db = Session.GetDatabase(serveur,dbMail.FilePath)
Set doc = db.CreateDocument
' REMINDER
Call doc.ReplaceItemValue("$Alarm",1) ' System flag
Call doc.ReplaceItemValue("Alarms","1") ' UI flag
Call doc.ReplaceItemValue("tmpOffset",30)
Call doc.ReplaceItemValue("$AlarmUnit","M")
' ======= Infos Calender ===============
doc.form = "Appointment"
doc.Subject ="RMA - Client : " & CurDoc.Client(0) & " - Fournisseur : " & CurDoc.Fournisseur(0)
doc.AppointmentType = "4"
doc.ExcludeFromView = "D"
' doc.StartDate = CurDoc.DateMAX(0)
' doc.StartDateTime = CurDoc.DateMAX(0)
'===============
Set item = CurDoc.GetFirstItem("DateMAX")
times = item.GetValueDateTimeArray()
count = 0
Forall t In times
count = count + 1
If Typename(t) = "NOTESDATETIME" Then
Messagebox t.LocalTime,, "1- Date/time # " & count
doc.StartDate = Cdat(t.LocalTime)
Elseif Typename(t) = "NOTESDATERANGE" Then
Messagebox "StartDateTime : " & t.StartDateTime.LocalTime & " - " & "EndDateTime : " & t.EndDateTime.LocalTime,, "2- Date/time # " & count
doc.StartDateTime = Cdat(t.StartDateTime.LocalTime)
End If
End Forall
'===============
Set rtitem = New NotesRichTextItem(CurDoc, "Body" )
Call rtitem.AppendText("Description: " & CurDoc.Description(0))
Call rtitem.AddNewline(2)
Call rtitem.AppendText("Raison du retour : " & CurDoc.RaisonRetour(0))
Call rtitem.AddNewline(2)
Call rtitem.AppendText("Détails : " & CurDoc.Details(0))
Call rtitem.AddNewline(2)
Call rtitem.AppendDocLink(CurDoc, "Cliquez ici pour les détails: ")
Set doc_cal = Workspace.EditDocument(True,doc)
End Sub
==============
Any clue will be appreciate
Thanks in advance
 
Feedback number WEBB8JVQLA created by ~Laura Bregeromar on 07/18/2011

Status: Open
Comments:

How create Reminder with LotusScrip... (~Laura Bregerom... 18.Jul.11)
. . RE: How create Reminder with LotusS... (~Joan Kinisonob... 17.Aug.11) |
|  |
|